import sys

from PyQt6.QtWidgets import QWidget, QVBoxLayout, QComboBox, QLineEdit, QApplication, QPushButton
from qfluentwidgets import setTheme, Theme, PushButton, SwitchButton, InfoBarPosition, InfoBar
from qfluentwidgets.components import layout


class FluentTest(QWidget):
    def __init__(self):
        super().__init__()
        self.setWindowTitle('Fluent Test')
        self.setGeometry(100,100,500,500)

        layout = QVBoxLayout()
        self.setLayout(layout)

        setTheme(Theme.DARK)

        button = PushButton("Click Me",self)
        button.clicked.connect(self.show_info)
        layout.addWidget(button)

        primary_button = PushButton("Primary button")
        layout.addWidget(primary_button)

        switch = SwitchButton('Toggle Switch')
        layout.addWidget(switch)

        combo = QComboBox()
        combo.addItems(['op1','op2','op4'])
        layout.addWidget(combo)

        line_edit = QLineEdit()
        line_edit.setPlaceholderText("Enter a number")
        layout.addWidget(line_edit)

    def show_info(self):
        InfoBar.success(
            title='success',
            content="You clicked the button",
            orient=InfoBarPosition.TOP,
            parent=self
        )

if __name__ == '__main__':
    app = QApplication(sys.argv)
    window = FluentTest()
    window.show()
    sys.exit(app.exec())